package com.cloud.business.controller;

import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.http.HttpServletRequest;

/**
 * 应用模块名称
 * Copyright: Copyright (C) 2020 DLANGEL, Inc. All rights reserved.
 * Company: 大连安琪科技有限公司
 *
 * @author Rex
 * @since 2020/4/15 18:25
 */
public class BaseController {

    @Autowired
    public HttpServletRequest request;

    /**
     * 获取header里的operationId
     *
     * @param
     * @return
     * @author Rex
     */
    public Integer getOperationId() {
//        return -1;
        return Integer.valueOf(request.getHeader("operationId"));
    }

    /**
     * 获取header里的指定key的值
     *
     * @param key
     * @return
     * @author Rex
     */
    public String getHeaderStr(String key) {
        return request.getHeader(key);
    }
}
